<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Title</title>
</head>
<body>
<div id="app">
    <div>
        <button v-on:click="switchImage">切换图片</button>
    </div>
    <img v-bind:src="showImgUrl" alt="">
    <img :src="showImgUrl" alt="">
    <a :href="href">百度一下</a>
</div>
<script src="https://unpkg.com/vue@3"></script>
<script>
    const app=Vue.createApp({
        data(){
            return{
                imgUrl1: "http://p1.music.126.net/agGc1qkogHtJQzjjyS-kAA==/109951167643767467.jpg",
                imgUrl2: "http://p1.music.126.net/_Q2zGH5wNR9xmY1aY7VmUw==/109951167643791745.jpg",

                showImgUrl: "http://p1.music.126.net/_Q2zGH5wNR9xmY1aY7VmUw==/109951167643791745.jpg",
                href: "http://www.baidu.com"
            }
        },
        methods:{
            switchImage(){
                this.showImgUrl=this.showImgUrl===this.imgUrl1?this.imgUrl2:this.imgUrl1
            }
        }
    })
    app.mount("#app")
</script>
</body>
</html>